Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Versioning the retail react app #1209

Merged
merged 296 commits into from
May 29, 2023
Merged

Versioning the retail react app #1209

merged 296 commits into from
May 29, 2023

Conversation

vmarta
Copy link
Contributor

@vmarta vmarta commented May 16, 2023

To get us ready to version the retail-react-app (or any other package in the monorepo) with its own independent version, this PR implements all of the scripts necessary to support the new release process.

Related spike PR #1167

Remaining tasks:

  • Fix bugs with the publishing script ← for more details, see the todos added in the code
  • Undo the changes made to the generator files

How to Test-Drive This PR

I've been testing the PR by going through the following scenarios: releasing the SDK, commerce-sdk-react, and then the retail-react-app. To thoroughly test them, please run a local npm registry first:

cd packages/pwa-kit-create-app
node scripts/run-local-npm.js

Releasing SDK v3.0.0

  1. cd <monorepo root>
  2. npm run bump-version -- 3.0.0-preview.0
  3. Verify that all of the packages are bumped, but independent packages like the retail-react-app would still be at their dev version but incremented (2.8.0-dev.0 → 2.8.0-dev.1)
  4. npm run bump-version -- 3.0.0

Switching to the publishing step. Now imagine that we have pushed our changes to GitHub and CI would take care of the publishing to npm.

  1. Open up the file publish-to-npm.js and edit the branchName to release-3.0.x.
  2. Commit all the changes to have a clean working tree
  3. npm run publish-to-npm
  4. all public packages should be published.

Switching to the clean-up steps:

  1. npm run bump-version -- 3.1.0-dev to prepare for the next minor release.
  2. Commit all the changes again, so you can test the next scenario from a clean slate.

Releasing commerce-sdk-react v1.0.0

  1. cd <monorepo root>
  2. npm run bump-version:commerce-sdk-react -- 1.0.0-preview.0
  3. The SDK dependencies should be downgraded to 3.0.0
  4. npm run bump-version:commerce-sdk-react -- 1.0.0

Switching to the publishing step. Now imagine that we have pushed our changes to GitHub and CI would take care of the publishing to npm.

  1. Open up the file publish-to-npm.js and edit the branchName to release-commerce-sdk-react-1.0.x.
  2. Commit all the changes to have a clean working tree
  3. npm run publish-to-npm
  4. Only the commerce-sdk-react package is published.

Switching to the clean-up steps:

  1. npm run bump-version:commerce-sdk-react -- 1.1.0-dev to prepare for the next minor release.
  2. The above step would restore the dev version of the SDK dependencies
  3. Commit all the changes again, so you can test the next scenario from a clean slate.

Releasing retail-react-app v1.0.0

These steps are pretty much the same as releasing the previous commerce-sdk-react.

  1. cd <monorepo root>
  2. npm run bump-version:retail-react-app -- 1.0.0-preview.0
  3. The SDK dependencies should be downgraded to 3.0.0
  4. npm run bump-version:retail-react-app -- 1.0.0

Switching to the publishing step. Now imagine that we have pushed our changes to GitHub and CI would take care of the publishing to npm.

  1. Open up the file publish-to-npm.js and edit the branchName to release-retail-react-app-1.0.x.
  2. Commit all the changes to have a clean working tree
  3. npm run publish-to-npm
  4. Only the retail-react-app package is published.

Switching to the clean-up steps:

  1. npm run bump-version:retail-react-app -- 1.1.0-dev to prepare for the next minor release.
  2. The above step would restore the dev version of the SDK dependencies

Checklists

General

  • Changes are covered by test cases
  • CHANGELOG.md updated with a short description of changes (not required for documentation updates)

Accessibility Compliance

You must check off all items in one of the follow two lists:

  • There are no changes to UI

or...

Localization

  • Changes include a UI text update in the Retail React App (which requires translation)

bfeister and others added 30 commits March 13, 2023 19:06
* resolve package lock errors

* clean console logs and code

* more cleanup, remove duplicate items in overrideregex

* upgrade minimatch version, match all file extensions, match with no file extension
…e/template-extensibility

* feature/template-extensibility-stress-test:
  fix some problems with final cleanup
  Remove all console logs / cleanup / unnecessary code
  fix dependency dupes
  add missing pwa-kit packages
  more fixes for out of sync package / lockfiles
  Add back missing `scripts` in package.json after bad merge
  Add missing template files
  fix bad upstream merge changes
  add the whole `template-retail-react-app` under `app` dir to stress test performance with high number of file overrides
  Fix `pwa-kit-dev` paths that didn't know about `overrides` in build pipeline

# Conflicts:
#	packages/_stress-test-project/build/loadable-stats.json
#	packages/commerce-sdk-react/package-lock.json
#	packages/internal-lib-build/package-lock.json
#	packages/pwa-kit-create-app/package-lock.json
#	packages/pwa-kit-dev/package-lock.json
#	packages/pwa-kit-dev/src/configs/webpack/config.js
#	packages/pwa-kit-dev/src/configs/webpack/plugins.js
#	packages/pwa-kit-react-sdk/package-lock.json
#	packages/pwa-kit-runtime/package-lock.json
#	packages/spike-extendend-retail-app/build/loadable-stats.json
#	packages/spike-extendend-retail-app/package-lock.json
#	packages/spike-extendend-retail-app/package.json
#	packages/template-retail-react-app/package-lock.json
#	packages/template-typescript-minimal/package-lock.json
…template extensibility, but `<path>/dir/non-index-name.(js|jsx|etc)` was not
@vmarta vmarta changed the base branch from feature/template-extensibility to develop May 26, 2023 16:02
@vmarta vmarta changed the base branch from develop to feature/template-extensibility May 26, 2023 16:08
@vmarta vmarta changed the base branch from feature/template-extensibility to develop May 26, 2023 21:08
Comment on lines 68 to 70
// TODO: is it possible to _not_ trigger the lifecycle scripts? See CHANGELOG.md
setPackageVersion(oldVersion, {cwd: location})
setPackageVersion('prerelease', {cwd: location})
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bug currently with the changelog file in commerce-sdk-react. Because the package has its own version, it will run into this code block, which will cause more headings to be added in the changelog file.

I'm thinking let's fix this bug in another PR, since it's not a blocker and the changelog can be manually fixed by hand.

GitHub Desktop 2023-05-26 at 15 21 05

@bfeister bfeister self-requested a review May 26, 2023 23:04
bfeister
bfeister previously approved these changes May 26, 2023
@bfeister
Copy link
Collaborator

Re-iterating the known PR check issue from #1205 (comment)

We are merging this without CI Windows passing. This is a known issue, but must be resolved for v3 to launch. A new GUS ticket is open here to track fixing this prior to an official / feature-complete v3 release:
W-13493426

@@ -0,0 +1,58 @@
/*
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we rename this file to bump-pwa-kit-deps-version? It is longer but give you a bit of a context what it does

@@ -0,0 +1,47 @@
#!/usr/bin/env node
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Can we rename this file as bump-independent-pkg-version.js?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, we can put these three scripts for version bumping into a separate folder

alexvuong
alexvuong previously approved these changes May 29, 2023
@vmarta vmarta dismissed stale reviews from alexvuong and bfeister via 7f66aec May 29, 2023 19:09
alexvuong
alexvuong previously approved these changes May 29, 2023
@@ -0,0 +1,79 @@
#!/usr/bin/env node
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This script is no longer in use. Should we remove it?

@bendvc bendvc merged commit 2983781 into develop May 29, 2023
bfeister added a commit that referenced this pull request May 30, 2023
* develop:
  Versioning the retail react app (#1209)
  [V3] Add `templateVersion` arg to `create-react-app` (#1229)
  [Extensibility 🤌🏻] Make `create-app` work with "extended templates" (#1205)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants